/*
 * Copyright (c) Created by T C L on 2019.7.10.
 */

package cn.mumzone.pos.ui.adapter;

import android.content.Context;

import cn.mumzone.basic.adapter.rv.CommonAdapter;
import cn.mumzone.basic.adapter.rv.ViewHolder;
import cn.mumzone.basic.util.AppDateUtil;
import cn.mumzone.pos.R;
import cn.mumzone.pos.model.DepositGoodsRecordEntity;

public class ADA_DepositGoodsReceiveRecord extends CommonAdapter<DepositGoodsRecordEntity> {
    public ADA_DepositGoodsReceiveRecord(Context context) {
        super(context);
    }

    @Override
    protected int itemLayoutId() {
        return R.layout.item_deposit_good_receive_record;
    }

    @Override
    protected void convert(ViewHolder holder, DepositGoodsRecordEntity depositGoodsRecordEntity, int position) {
        holder.setText(R.id.tv_count, String.valueOf(depositGoodsRecordEntity.getReceiveNum()));

        holder.setText(R.id.tv_time, AppDateUtil.getTimeStamp(depositGoodsRecordEntity.getCreateTime(),
                AppDateUtil.YYYY_MM_DD_HH_MM));


        if (depositGoodsRecordEntity.getReceiveType() == 0) {
            holder.setVisible(R.id.iv_return_type, false);
        } else {
            holder.setVisible(R.id.iv_return_type, true);
        }

    }
}
